<?
@ session_start();
@ini_set('display_errors', 'off');
include_once("class.lib/db.class.php");
include_once("class.lib/user.class.php");
include_once("class.lib/captcha.class.php");
include_once("class.lib/universite.class.php");
include_once("class.lib/etablissement.class.php");
include_once("class.lib/grade.class.php");
include_once("class.lib/aa_type_candidature.class.php");
include_once("class.lib/aa_complement_infos.class.php");
include_once "class.lib/aa_complement_infos.class.php";
include_once "class.lib/aa_complement_infos_porteur.class.php";

include_once("class.lib/personne.class.php");
if(isset($_SESSION["cin"]))$cin=$_SESSION["cin"];
if(isset($_GET['id_ue'])) $id_ue=$_GET['id_ue'];


	$personne = new personne();
	$personne->SELECT(" AND CIN=".$_SESSION["cin"]);


	$_aa_complement_infos_porteur=new aa_complement_infos_porteur();
	//$_aa_complement_infos_porteur->set_CIN(intval($_SESSION["cin"]));
	//$_aa_complement_infos_porteur->SELECT(" AND CIN=".$_SESSION["cin"]);
	$row=$personne->fetch_object();
	
	/*while($row=$_aa_complement_infos_porteur->fetch_object())
	{
	var_dump($row);
	}*/

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Soumission de Projet</title>
		<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="iso-8859-1" />
		<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="iso-8859-1" />
		<script src="js/jquery.js" type="text/javascript"></script>	
		<script src="js/jquery.validationEngine-fr.js" type="text/javascript"></script>  
		<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
		<script type="text/javascript" src="javascript.js"></script>
		
		<style>
				H1 {
			PADDING-LEFT: 30px; FONT-SIZE: 1.2em; BACKGROUND: url(../pix/tit_sucre_ambiance0.gif) no-repeat 0px 0.3em; MARGIN: 0px 0px 5px; COLOR: #7f42a5
		}
		H3 {
			FONT-SIZE: 9px;  COLOR: #DD0269; MARGIN: 0px 0px 0px;
		}
		BODY {
			background:url(../images/fond_soumission.gif) no-repeat;
			background-position:50% 50%;
				}
		</style>
		

	</head>
	<body>
		
	<table align="center">
	 <tr align="center"><td><img src="images/profile.png"  /></td>
	 <td align="right"><h1><font color="DD0269">MODIFICATION DE PORTEUR DU PROJET</font></h1>
	
	 <br/></td>
	 </tr>
	</table>
	
		<table width="90" border="0" align="center" cellpadding="0" cellspacing="0" >
		  <tr> 
			
			<td><img src="images/etape1_on.jpg" width="90" height="20" border="0"/></td>
			<!--<td><img src="images/etape2_off.jpg"   width="90" height="20" border="0"/></td>-->
		   <td><a href="modif_cours.php?id_ue=<?echo $_GET['id_ue'];?>"><img src="images/etape2_off.jpg"  width="90" height="20" border="0"/></a></td>
		  
			<td><a href="modif_partenaire.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape3_off.jpg" width="90" height="20" border="0"/></a></td>
			<td><a href="modif_equipe.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape4_off.jpg" width="90" height="20" border="0"/></a></td>
			
		  </tr>
		</table>

		<form id="formID" class="formular" method="post" action="modif_inscription.php"><b>IDENTIFICATION DU PORTEUR DU PROJET</b>
		<fieldset>
				<legend>Param&ecirc;tres de votre compte</legend>
				<label>
					<span>Nom d'utilisateur : </span>
					<input class="validate[required,custom[noSpecialCaracters],length[0,20]]" type="text" name="login" id="login" value="<?php echo $row->login;?>" />
				</label>
				<label>
					<span>Mot de passe : </span><br>
					<?php echo 'Le mot de passe en claire : <strong>'. $row->MotPasse.'</strong><br>';?>
					<input class="validate[required,length[2,6]] text-input" type="password" name="password"  id="password" value="<?php echo $row->MotPasse;?>"/>
				
				</label>
				<label>
					<span>Confirmation de votre mot de passe : </span>
					<input class="validate[required,confirm[password]] text-input" type="password" name="password2"  id="password2" value="<?php echo $row->MotPasse;?>" />
				</label>
			</fieldset>
		
		<fieldset>
		
		<?php 
		          $Type_Candidature = new Type_Candidature();
                  $u=$Type_Candidature->getAllType();
				 // var_dump($Type_Candidature);
		?>
		<legend>La candidature est pr&eacute;sent&eacute;e par</legend>
		<label> <span></span>
		<select name="code_type_cand" id="code_type_cand"  class="validate[required]" title="Choisir La candidature">
                <option value=""></option>
		<?php		    
				  // Liste des universités
                 while (list($clef,$valeur)=each($u)) 
				     {  $libelle = strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
						$str=($row->code_type_cand==$valeur[0] ?  ' selected="selected" ' :'');
						echo '<OPTION value="'.$valeur[0].'" '.$str.'   >'.$libelle.'</OPTION>';
                     }
		  ?>
              </select>
		</label>	
		<em>
		N.B. La candidature d'un &eacute;tablissement doit &ecirc;tre pr&eacute;sent&eacute;e par le chef de l'&eacute;tablissement.  
		</em>	
		</fieldset>
		
		<fieldset>
				<legend>Porteur du projet  </legend>
			
					<input  type="hidden" name="id_ue" id="id_ue"		value="<?php echo $id_ue ;?>"/>
				<label> 
					<span>Nom : </span>
					<input class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="firstname" id="firstname"
					value="<?php echo $row->	Nom;?>"
					/>
				</label>
				<label>
					<span>Pr&eacute;nom : </span>
					<input class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="lastname" id="lastname"
					value="<?php echo $row->Prenom ;?>"
					/>
				</label>
				<label>
					<span>Grade :</span>
				<select name="grade" id="grade" maxlength="50"  class="validate[required]" >
					<option value="">Choisissez votre grade</option>
					<?php 
		          $grade = new Grade();
                  $g=$grade->getGrade();
				  // Liste des grades
                 while (list($clef,$valeur)=each($g)) 
				     {  if($valeur[0]<10) $valeur[0]="0".$valeur[0];
						$str=($row->grade==$valeur[0] ?  ' selected="selected" ' :'');
						echo "<OPTION value=".$valeur[0]." $str >$valeur[2]</OPTION>";
                     }
		        ?>
				</select>
				
				</label>
				
				
				<label>
				<span>Sp&eacute;cialit&eacute; : </span>
					<input class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="specialite" id="specialite"
					value="<?php echo $row->specialite ;?>"
					/>
				</label>
				
				<label>
					<span>Fonction : </span>
					<input class="text-input" type="text" name="fonction" id="fonction" value="<?php echo $row->fonction ;?>" />
				</label>
				
				

				
				  
             <label>
			 <span>Universit&eacute; :</span>
			<select name="universite" id="universite" maxlength="50" 
			OnChange="if (this.value=='') {} else if (this.value=='autre') {  document.getElementById('autre_universite').style.display =''; } else sendData('id=a'+this.value+'&etab='+'<?php echo $row->IdentifiantInstitutionnel;?>','etablissement2.php','contenu')" onKeyUp="if (this.value=='') {} else if (this.value=='autre') {  document.getElementById('autre_universite').style.display =''; } else sendData('id=a'+this.value+'&etab='+'<?php echo $row->IdentifiantInstitutionnel;?>','etablissement2.php','contenu')" class="validate[required]" title="Veuillez selectionner votre Universit&eacute; SVP!">
                <option value="">Choisir Universit&eacute;</option>
				<option value="autre" <?php $str=($row->IdentifiantInstitutionnel=='autre' ?  ' selected="selected" ' :''); echo $str;  ?>>Autre</option>
			    <?php 
		          $univ = new Universite();
                  $u=$univ->getAllUniversite();
				  // Liste des universit�s
                 while (list($clef,$valeur)=each($u)) 
				     {  $libelle = strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
					    if($valeur[0]<10) $valeur[0]="0".$valeur[0];
						$str=($row->IdentifiantInstitutionnel==$valeur[0] ?  ' selected="selected" ' :''); 	
						echo "<OPTION value=".$valeur[0]."   $str >".$libelle."</OPTION>";
                     }
		  ?>
              </select>
			 </label>
			 
			 	<label id="autre_universite"  style="display:none;">
					<span>Autre Universit&eacute; : </span>
					<input class="text-input" type="text" name="autreuniversite" id="autreuniversite" value="<?php echo $row->autreuniversite ;?>" />
				</label>
			 
			 <label>
			  <span id="contenu" >
              <span>Etablissement :</span>
            <select name="etablissement" id="etablissement" maxlength="23" class="validate[required]" title="Veuillez selectionner votre Etablissement SVP!"
			
			 OnChange="if(this.value=='autre') {  document.getElementById('autre_etablissement').style.display =''; } " 
			 onKeyUp=" if(this.value=='autre') {  document.getElementById('autre_etablissement').style.display ='';} " 
				   
			>
               <option value="">Choisir Etablissement</option>
			   <option value="autre"  <?php $str=($row->CategoriePrincipaleUsager=='autre' ?  ' selected="selected" ' :''); echo $str;  ?>>Autre</option>
			</select> 
			</span>
			 </label>
			 
			 	<label id="autre_etablissement" style="display:none;">
					<span>Autre &Eacute;tablissement : </span>
					<input class="text-input" type="text" name="autreetablissement" id="autreetablissement" />
				</label>
			 
			 <em>
			 N.B. M&ecirc;me si la candidature est pr&eacute;sent&eacute;e par un &eacute;tablissement universitaire, un porteur du projet est n&eacute;cessaire. Il assurera le pilotage du projet et sera l'interlocuteur de l'UVT pour toutes les questions techniques et p&eacute;dagogiques concernant le projet. Il animera l'&eacute;quipe du projet.
			 </em>
			</fieldset>
            
		<fieldset>
				<legend>Coordonn&eacute;es du porteur du projet </legend>	
                <table>
                <tr>
                	<td>
                        <label>
                            <span>N&deg;CIN : </span>
                            <input class="validate[required,custom[onlyNumber],length[8,8]] text-input" type="text" size="8" maxlength="8" name="ncin"  id="ncin"  value="<?php echo $row->	CIN ;?>" />
                        </label>
					</td>
    			</tr>
                
                 <tr>
                	<td>
                    <label>
                    	<span>Email  : </span>
                        <input class="validate[required,custom[email]] text-input" type="text" name="email" id="email"    value="<?php echo $row->Mail ;?>" />
                    </label>
                	</td>
    			</tr>
                 <tr>
                	<td>
                        <label>
                            <span>Confirmation email : </span>
                            <input class="validate[required,confirm[email]] text-input" type="text" name="email2"  id="email2"  value="<?php echo $row->Mail ;?>"  />
                        </label>
					</td>
    			</tr>
				
                 <tr>
                	<td>
                        <label>
                            <span>Adresse : </span>
                            <textarea class="validate[required] text-input" type="text" name="AdressePostale" id="AdressePostale"  >   <?php 
							
							$arr=split('-',$row->AdressePostale);
							echo trim($arr[0]);?></textarea>
                        </label>
					</td>
                	<td>
                        <label>
                            <span>Ville : </span>
                            <input class="validate[required,custom[onlyLetter]] text-input" type="text" name="ville" id="ville"  value="<?php echo $row->ville ;?>"  />
                        </label>
				
                        <label>
                            <span>Code Postale : </span>
                            <input class="validate[required,custom[onlyNumber],length[4,8]] text-input" type="text" name="CodePostale" id="CodePostale"   value="<?php 
							$arr=split('-',$row->AdressePostale);
							echo trim($arr[1]);?>"  />
                        </label>
					</td>
    			</tr>
				
                
                 <tr>
                	<td>
                        <label>
                            <span>GSM : </span>
                            <input class="validate[required,custom[telephone]] text-input" type="text" name="NumMobile"  id="NumMobile"
								value="<?php echo $row->NumMobile ;?>"
							/>
                        </label>
					</td>
                	<td>
                        <label>
                            <span>T&eacute;l&eacute;phone fixe : </span>
                            <input class="text-input" type="text" name="NumTelephone"  id="NumTelephone" 	value="<?php echo $row->	NumTelephone ;?>"/>
                        </label>
					</td>
    			</tr>
                
                 <tr>
                	<td>
                        <label>
                            <span>Fax : </span>
                            <input class="text-input" type="text" name="fax"  id="fax" 	value="<?php echo $row->NumFax ;?>" />
                        </label>
                	</td>
    			</tr>
				</table>
			

				
				
		</fieldset>
			
			
		<fieldset>
		
		<?php 
		         $Complement_Infos = new Complement_Infos();
                  $u=$Complement_Infos->SELECT_S(" AND a.CIN=".$_SESSION['cin']);
				 //   $u=$_aa_complement_infos_porteur->fetch_object();
				 // var_dump($Type_Candidature);
		?>
		<legend>Informations compl&eacute;mentaires</legend>
		<label> <span></span>
		<em>Le porteur du projet a-t-il une exp&eacute;rience ou a-t-il re&ccedil;u une formation dans l'un des domaines suivants ?</em>
		<br /><br />
		<table>
        	<tr>
            	<td></td>
                <td></td>
                <td>Oui</td>
                <td>Non</td>
            </tr>
		<?php		    
				  
				  /*while($row=$_aa_complement_infos_porteur->fetch_object())
				  {
				  
				  }*/
				
                 while (list($clef,$valeur)=each($u)) 
				     {  
					    $libelle = $valeur[1];//strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
					   
					   	echo "
						<tr>
							<td>".$libelle."</td>
							<td><input type=\"hidden\" name=\"label".$valeur[0]."\" value=\"".$valeur[0]."\" /></td>
						  ";
						echo "<td>
								<span>
									<label for=\"choix".$valeur[0]."\"></label><input type=\"radio\" name=\"choix".$valeur[0]."\" value=\"oui\" onclick=\"$('#observation$valeur[0]').show()\" ".($valeur[3]=="oui"  ? "checked=\"checked\"" :"")." />
									</span>
									</td>";
						echo "<td><span><label for=\"choix".$valeur[0]."\"></label><input type=\"radio\" name=\"choix".$valeur[0]."\" value=\"non\" onclick=\"$('#observation$valeur[0]').hide()\" ".($valeur[3]=="non"  ? "checked=\"checked\"" :"")."  /></span> </td>";
						echo "<td  style=\"".($valeur[3]=="oui"  ? "display:'';" :"display:none;")."\" id=\"observation".$valeur[0]."\"><span><label for=\"observation".$valeur[0]."\" >Si Oui Pr&eacute;cisez :</label><textarea  style=\" width: 250px;height: 17px;\" rows=\"2\" cols=\"20\" name=\"observation".$valeur[0]."\"  >".$valeur[2]."</textarea></span> </td>";
						echo "</tr>";
                     }
		  ?>
		</table>			
	
		</label>	  
		</fieldset>
			

			
						


<br /><br />




<!-- captcha -->

			<p><input class="submit" type="submit" value="ETAPE SUIVANTE" /></p>
<hr/>
</form>
		
	</body>
</html>